package com.wxq.demo.controller;

import com.wxq.demo.activemq.TopicProducter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TopicController {
    @Autowired
    private TopicProducter topicProducter;

    @GetMapping("/publish")
    public String publish(String msg) {
        topicProducter.sendMessage(msg);
        return "消息已发布";
    }
}
